package com.sxm.yiwei.pinche;

import android.webkit.WebView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.sxm.yiwei.R;
import com.sxm.yiwei.base.BaseActivity;
import com.sxm.yiwei.constant.Constant;

public class RuleActivity extends BaseActivity {


    private RelativeLayout rl_back;
    private TextView tv_title;
    private WebView webView;
    private int type;

    @Override
    public void setContentView() {
        setContentView(R.layout.activity_rule);
    }

    @Override
    public void initView() {
        rl_back = (RelativeLayout)findViewById(R.id.rl_back);
        tv_title = (TextView)findViewById(R.id.tv_title);
        webView = (WebView)findViewById(R.id.webview);
    }

    @Override
    public void initListener() {
        rl_back.setOnClickListener(this);
    }

    @Override
    public void initData() {
        type = getIntent().getIntExtra("type",-1);
        switch (type){
            case Constant.PINCHE_RULE:
                tv_title.setText("拼车规则");
                webView.loadUrl("file:///android_asset/pinche_rule.html");
                break;
            case Constant.PINCHE_COUNT_RULE:
                tv_title.setText("拼车计价规则");
                webView.loadUrl("file:///android_asset/pinche_count_rule.html");
                break;
            case Constant.REFUND_CHANGE_RULE:
                tv_title.setText("退票/改签规则");
                webView.loadUrl("file:///android_asset/refund_change_rule.html");
                break;
        }

    }
}
